package com;

import com.itheima.config.SpringConfig;
import com.itheima.domain.User;
import com.itheima.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class AppTest {
    public static void main(String[] args) {

        ApplicationContext ac=new AnnotationConfigApplicationContext(SpringConfig.class);
        UserService us = (UserService) ac.getBean("userService");
        User byId = us.findById("2");
        System.out.println(byId);
    }
}
